//
//  BBQPitBooking.m
//  bbqpitbooking
//
//  Created by Kyaw Phyu Aung on 5/22/11.
//  Copyright 2011 iss. All rights reserved.
//

#import "BBQPitBooking.h"
#import "BBQPit.h";
#import "Customer.h"


@implementation BBQPitBooking

@synthesize bbqPit,customer,bookingDate,submitDate,bookingStatus,selectedPits,bookingID;


- (id) init {
	[super init];
	bbqPit = [[BBQPit alloc] init];
	customer = [[Customer alloc] init];
	//bookingID = [self assignBookingRefNo];
	return self;
}


-(NSString*) assignBookingRefNo{
	NSDateFormatter *format = [[NSDateFormatter alloc] init];
	[format setDateFormat:@"yyyyMMddhhmmss"];
	
	NSDate *now = [[NSDate alloc] init];
	NSString *dateString = [format stringFromDate:now];
	
	NSString *bookingRef = [NSString stringWithFormat:@"BBQ-%@",dateString];
	[format release];
	[now release];
	return bookingRef;
}

@end
